| Total Complexity | 1 |
| Total Lines | 13 |
| Duplicated Lines | 0 % |
| Changes | 0 | ||
| 1 | import { Inject } from '@nestjs/common'; |
||
| 6 | |||
| 7 | export class GetLeavesByMonthQueryHandler { |
||
| 8 | constructor( |
||
| 9 | @Inject('ILeaveRequestRepository') |
||
| 10 | private readonly leaveRequestRepository: ILeaveRequestRepository |
||
| 11 | ) {} |
||
| 12 | |||
| 13 | async execute(query: GetLeavesByMonthQuery): Promise<LeavesCollection> { |
||
| 14 | const leaves = await this.leaveRequestRepository.findAcceptedLeaveRequestsByMonth( |
||
| 15 | query.date |
||
| 16 | ); |
||
| 17 | |||
| 18 | return new LeavesCollection(leaves); |
||
| 19 | } |
||
| 21 |